package com.eaglefly.redis.utils;

/**
 * 功能：
 * 时间：2018/1/9 18:05
 *
 * @author zhaojinpeng
 */
public class StringUtils {

    public static String getBeanNameFormClassName(String className) {
        String simpleName = getSimpleName(className);
        return toFirstLowerCase(simpleName);
    }

    public static String getSimpleName(String className) {
        String[] split = className.split("\\.");
        if (split.length == 0) {
            return className;
        } else {
            return split[split.length - 1];
        }
    }

    public static String toFirstLowerCase(String name) {
        String head = name.substring(0, 1).toLowerCase();
        String fail = name.substring(1);
        return head + fail;
    }
    
}
